package config

import (
	"github.com/BurntSushi/toml"
)

type tomlConfig struct {
	MQS tServiceConfig
}

type tServiceConfig struct {
	Port int
	LogDir string
}

var gServiceConfig = &tServiceConfig{}

func init() {
	cfg := &tomlConfig{}
	if _,err := toml.DecodeFile("./mqs.toml", cfg);err != nil {
		panic(err)
	}
	*gServiceConfig = cfg.MQS
}

func GetPort() int {
	return gServiceConfig.Port
}

func GetLogDir() string {
	return gServiceConfig.LogDir
}
